set(st_main_files
	"SimpleTriangle.h"
	"SimpleTriangleApp.cpp"
	"SimpleTriangleApp.h"
)

set(st_resource_files
	"Resource.h"
	"small.ico"
	"SimpleTriangle.ico"
	"SimpleTriangle.rc"
)

set(st_link_libs app core gd io mem resource_manager utils)

if(MSVC)

	set(st_all_files
		${common_misc_files}
		${st_main_files}
		${st_resource_files}
        "win32/SimpleTriangle_win32.cpp"
	)
	add_executable( SimpleTriangle WIN32 ${st_all_files} )
	add_prjs_target(SimpleTriangle)

	source_group(resources FILES ${st_resource_files})

	set(st_link_libs ${st_link_libs} app_win gd_win)

elseif(APPLE)

	set(st_all_files
		${common_misc_files}
		${st_main_files}
	)
	add_executable( SimpleTriangle MACOSX_BUNDLE ${st_all_files} )

else()

	set(st_all_files
		${common_misc_files}
		${st_main_files}
        "unix/SimpleTriangle_unix.cpp"
	)
	add_executable( SimpleTriangle ${st_all_files} )

	set(st_link_libs ${st_link_libs} app_unix gd_unix)

endif()

source_group(main FILES ${st_main_files})

add_dependencies(SimpleTriangle copy_externals)

target_link_libraries (SimpleTriangle ${st_link_libs})

add_common_properties(SimpleTriangle)

set_target_properties (SimpleTriangle PROPERTIES
	RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

install (TARGETS SimpleTriangle DESTINATION "bin")

#install (FILES "${EXTERNALS_ROOT}/tbb/bin/x86/tbbmalloc_debug.dll" DESTINATION "bin" CONFIGURATIONS Debug)
#install (FILES "${EXTERNALS_ROOT}/tbb/bin/x86/tbbmalloc_debug.pdb" DESTINATION "bin" CONFIGURATIONS Debug)

#install (FILES "${EXTERNALS_ROOT}/tbb/bin/x86/tbbmalloc.dll" DESTINATION "bin" CONFIGURATIONS Release)
#install (FILES "${EXTERNALS_ROOT}/tbb/bin/x86/tbbmalloc.pdb" DESTINATION "bin" CONFIGURATIONS Release)
